<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>大声叭叭</title>
    <link rel="stylesheet" href="/static/css/bulma.min.css" th:href="@{/css/bulma.min.css}">
    <link rel="stylesheet" href="/static/css/community.css" th:href="@{/css/community.css}">
    <script type="text/javascript" src="/static/js/jquery-3.7.1.min.js" th:src="@{/js/jquery-3.7.1.min.js}"></script>
    <script type="text/javascript" src="/static/js/awesome.js" th:src="@{/js/awesome.js}"></script>
    <script type="text/javascript" src="/static/js/community.js" th:src="@{/js/community.js}"></script>
<!--    <script type="text/javascript" src="/static/js/notice.js" th:src="@{/js/notice.js}"></script>-->
</head>
<body class="has-navbar-fixed-top">

<!-- 导航栏内容 -->
<div th:replace="~{common/nav::nav(current=1,size=10,keyword='')}"></div>
<!-- 中间部分内容 -->
<section class="section">
    <div class="container is-max-widescreen ">
        <div class="columns is-desktop index-top">
            <div class="column is-3"></div>
            <div class="column is-6">
                <div class="card index-card-border">
                    <header class="card-header-title">
                        休闲社区
                    </header>
                    <div class="divider"></div>
                    <div class="card-content">
                        <div class="columns">
                            <div class="column is-6">
                                <img th:src="@{/img/login2.jpg}" src="/static/img/login2.jpg" alt="" height="400" width="300" style="border-radius: 5px">
                            </div>
                            <div class="column is-6">
                                <div class="login-container">
                                    <!--TODO 等待修改为Gitee的标签-->
                                    <a id="gitee-link"
                                       class="button is-rounded is-outlined is-dark is-normal login-box"
                                       th:href="@{'https://gitee.com/oauth/authorize?client_id='+${gitee_client_id}+'&redirect_uri='+${gitee_redirect_uri}+'&response_type=code&scope=user_info%20emails'}"
                                       title="Login with GitHub">
                                    <span class="icon">
                                        <i class="fa-brands fa-github-alt"></i>
                                    </span>
                                        <span>Gitee登录</span>
                                    </a>
                                    <a id="github-link"
                                       class="button is-rounded is-outlined is-link is-normal login-box "
                                       th:href="@{'https://github.com/login/oauth/authorize?client_id='+${github_client_id}+'&redirect_uri='+${github_redirect_uri}+'&scope=user,repo'}"
                                       title="Login with GitHub">
                                    <span class="icon">
                                        <i class="fab fa-github"></i>
                                    </span>
                                        <span>GitHub登录</span>
                                    </a>
                                </div>
                                <span th:if="msg!=null" th:text="${msg}"></span>
                            </div>
                        </div>
                    </div>

                </div>

            </div>
            <div class="column is-3"></div>
        </div>
    </div>
</section>
<!-- 底部部分内容 -->
<div th:replace="~{common/footer::footer}"></div>
</body>

<script>
    function addTimestampToLink() {
        const link = document.getElementById('github-link');
        const timestamp = Date.now();
        const href = link.getAttribute('href');
        const updatedHref = href + '&state=' + timestamp;
        link.setAttribute('href', updatedHref);
    }
    addTimestampToLink();
</script>
</html>